{% extends 'index.html' %}
{% load crm_tags %}
{% block pg-content %}
    <div class="panel panel-info">
        <div class="panel-heading">班级管理</div>
        <div class="panel-body">
            <table class="table  ">
                <thead>
                    <tr>
                        <th>课程名称</th>
                        <th>班级</th>
                        <th>开课日期</th>
                        <th>结业日期</th>
                        <th>课程进度</th>
                        <th>批改作业</th>

                    </tr>
                </thead>
                <tbody>
                    {% for class in request.user.classlist_set.all %}
                        <tr>
                            <td>{{ class.course }}</td>
                            <td>s{{ class.semester }}</td>
                            <td>{{ class.start_date|date:"Y-m-d" }}</td>
                            <td>{{ class.end_date|date:"Y-m-d" }}</td>
                            <td>已上{{ class.courserecord_set.count }}节</td>
                            <td><a href="{% url 'courserecords' class.id %}">作业管理</a></td>
                       </tr>

                    {% endfor %}
                </tbody>

            </table>
        </div>
</div>

{% endblock %}